﻿Public Class viewprofile3
    Inherits System.Web.UI.Page

	Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
		If Not Page.IsPostBack Then
			LoadBank()
			If GlobalApp.ProfileInfo IsNot Nothing Then
				LoadData()
			End If
		End If
	End Sub

	Private Sub LoadBank()

		Me.BANK_ID.DataTextField = "BANK_NAME"
		Me.BANK_ID.DataValueField = "BANK_ID"
		Me.BANK_ID.DataSource = BL.Bank.GetAll
		Me.BANK_ID.DataBind()
		Me.BANK_ID.Items.Insert(0, New ListItem("--กรุณาระบุชื่อธนาคาร--", "0"))
	End Sub

	Private Sub LoadData()
		Dim registerInfo As Entity.OfficerInfoItem
		registerInfo = GlobalApp.ProfileInfo
		With registerInfo
			Me.OFFICER_BANK_ACCOUNT_NAME.Text = .officer_bank_account_name
			Common.Utility.SelectChoice(Me.BANK_ID, .bank_id)
			Me.OFFICER_BANK_BRANCH.Text = .officer_bank_branch
			Me.OFFICER_BANK_ACCOUNT_CODE.Text = .officer_bank_account_code
		End With
	End Sub

	Protected Sub btnBack_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnBack.Click
		Response.Redirect("viewprofile2.aspx", False)
	End Sub

	Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCancel.Click
		Response.Redirect("mainpage.aspx", False)
	End Sub

	Protected Sub btnFirst_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnFirst.Click
		Response.Redirect("viewprofile.aspx", False)
	End Sub
End Class